Fix that executing applescript may hang emacs uninterruptedly.
authorJan D. <jan.h.d@swipnet.se>
Sun, 14 Aug 2011 10:39:38 +0000 (12:39 +0200)
committerJan D. <jan.h.d@swipnet.se>
Sun, 14 Aug 2011 10:39:38 +0000 (12:39 +0200)
commitd4e6ba9b07dc6a24a3b9089dbd5010b69c733af4
tree678a04a06d4667560405b260db1bdec63287a840
parent37ffc6746ca60b1ada8014b1cd7280dafde6df82
Fix that executing applescript may hang emacs uninterruptedly.

* nsfns.m (as_script, as_result, as_status): New static variables.
(ns_run_ascript): New function.
(Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
the event loop.  Get status from as_status.

* nsterm.h (ns_run_ascript): Declare.
(NSAPP_DATA2_RUNASSCRIPT): Define.

* nsterm.m (sendEvent): If event is NSApplicationDefined and
data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
the event loop (Bug#7276).
src/ChangeLog
src/nsfns.m
src/nsterm.h
src/nsterm.m